T_CONST ➔ ... ➔ ???   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
dl 0
loc 1
rs 10
c 0
b 0
f 0
nop 2
1
const fs = require('fs')
2
const path = require('path')
3
4
const storeMethods = async groups => {
0 ignored issues
show
Bug introduced by
The variable async seems to be never declared. If this is a global, consider adding a /** global: async */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
5
  const keys = Object.keys(groups)
6
  const promises = keys.map(key => new Promise((resolve, reject) => {
7
    fs.writeFile(
8
      path.resolve(__dirname, `../../available/${key}.json`),
9
      JSON.stringify(groups[key], null, 2),
10
      err => {
11
        if (err) {
12
          reject(err)
13
          return
14
        }
15
        resolve({ [key]: true })
16
      })
17
  }))
18
19
  return Promise.all(promises)
20
}
21
22
module.exports = { storeMethods }
23